//
//  AuditViewController.m
//  cm
//
//  Created by suyibaishan on 2017/11/6.
//  Copyright © 2017年 feihu. All rights reserved.
//

#import "AuditViewController.h"

@interface AuditViewController ()

@end

@implementation AuditViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createAuditView];
}

-(void)createAuditView
{
    self.titleLabel.text = @"信息审核中";
    self.backButton.hidden = NO;
    
    UIImageView *logoImage = [[UIImageView alloc] initWithFrame:CGRectMake((kScreenWidth - 60)/2, kScreenWidth * 0.45f, 60, 60)];
    logoImage.image = [UIImage imageNamed:@"circle"];
//    logoImage.backgroundColor = [UIColor redColor];
    [self.view addSubview:logoImage];
    
    UILabel *detailLabel = [[UILabel alloc] init];
    detailLabel.font = [UIFont systemFontOfSize:18];
    detailLabel.numberOfLines = 2;
    detailLabel.textAlignment = NSTextAlignmentCenter;
    detailLabel.text = @"您的资料已经提交审核\n请等待";
    detailLabel.textColor = [UIColor blackColor];
    [self.view addSubview:detailLabel];
    detailLabel.sd_layout
    .topSpaceToView(logoImage, 10)
    .leftSpaceToView(self.view, 25)
    .widthIs(kScreenWidth - 50)
    .heightIs(45);
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeSystem];
    backButton.backgroundColor = [UIColor colorWithRed:0.19 green:0.53 blue:0.98 alpha:1];
    [backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [backButton setTitle:@"回到首页" forState:UIControlStateNormal];
    backButton.titleLabel.font = [UIFont systemFontOfSize:15];
    backButton.layer.cornerRadius = 20;
    [backButton addTarget:self action:@selector(backButtonHandler:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backButton];
    backButton.sd_layout
    .leftSpaceToView(self.view, 40)
    .topSpaceToView(detailLabel, 35)
    .widthIs(kScreenWidth - 80)
    .heightIs(40);
}

-(void)backButtonHandler:(id)sender
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"CANCELLOGIN" object:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
